/**
 * 
 */
package expressions;

import tester.cobertura.Instrument;

/**
 * Title : Not
 * 
 * Javadoc Online at : http://www.ccs.neu.edu/home/ada2358/Doc/Satisfiability/index.html
 * @author Adam Blackwell
 * @version 1.0
 * @since April 2nd 2009
 */
@Instrument
public class Not extends BE{
  /* Fields */
  private BE be;
  
  /**
   * Constructor :
   * @param be
   */
  public Not(BE be) {
    super();
    this.be = be;
  }

  /* (non-Javadoc)
   * @see expressions.BE#accept(expressions.BEVisitor)
   */
  @Override public <R> R accept(BEVisitor<R> visit) {
    // TODO Auto-generated method stub
    return visit.forNot(this.be);
  }

  /* (non-Javadoc)
   * @see expressions.BE#hashCode()
   */
  @Override public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((be == null) ? 0 : be.hashCode());
    return result;
  }

  /* (non-Javadoc)
   * @see expressions.BE#equals(java.lang.Object)
   */
  @Override public boolean equals(Object obj) {
    if (this == obj)
      return true;
    if (getClass() != obj.getClass())
      return false;
    Not other = (Not) obj;
    if (be == null) {
      if (other.be != null)
        return false;
    } else if (!be.equals(other.be))
      return false;
    return true;
  }

}
